package com.opennetexam.manager.enums;

/**
 * @author 奶茶
 * Created by on 2017/12/7.
 */
public enum CertificateType {

    Other("未知",0),
    IdentityCard("身份证",1),
    OfficerCard("军官证",2),
    PassportCard("护照",3),
    ResidentCard("港、澳、台居民证件",4),
    OpenCard("国家汉办卡号",5),
    StudentId("学号",6),
    ;

    String display;
    Integer prefix;

    CertificateType(String display, Integer prefix) {
        this.display = display;
        this.prefix = prefix;
    }

    public String getDisplay() {
        return display;
    }

    public void setDisplay(String display) {
        this.display = display;
    }

    public Integer getPrefix() {
        return prefix;
    }

    public void setPrefix(Integer prefix) {
        this.prefix = prefix;
    }

    /**
     * 根据证件类型获取证件名称
     * @param prefix
     * @return
     */
    public static String getcertificateType (Integer prefix){
        String typeName = "";
        switch (prefix)
        {
            case 0:
                typeName = "未知";
                break;
            case 1:
                typeName = "身份证";
                break;
            case 2:
                typeName = "军官证";
                break;
            case 3:
                typeName = "护照";
                break;
            case 4:
                typeName = "港澳台居民证件";
                break;
            case 5:
                typeName = "国家汉办卡号";
                break;
            case 6:
                typeName = "学号";
                break;
        }
        return typeName;
    }
}
